<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../template/staffTemplate.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:t="http://myfaces.apache.org/tomahawk"
                xmlns:f="http://java.sun.com/jsf/core">

    <ui:define name="content1">
        <div class="col-6 col-sm-6 col-lg-6">
            <script type="text/javascript" src="../../ckeditor/ckeditor.js"></script>
            <h:form id="form">
                <h:selectOneMenu value="#{staffCourses.center}" converter="#{centerConverter}">
                    <f:selectItems value="#{staffCourses.allCenter}" var="c" itemLabel="#{c.name}"
                                   itemValue="#{c}"/>
                    <f:ajax render="d1" listener="#{staffCourses.selectCenter}" />
                </h:selectOneMenu>
                <p/>
                <h:dataTable value="#{staffCourses.currListCourse}" var="c" id="d1" border="1" width="700" >
                    <h:column>
                        <f:facet name="header">Center</f:facet>
                            #{c.centers.name}
                    </h:column>
                    <h:column>
                            <f:facet name="header">Name</f:facet>
                                #{c.name}
                    </h:column>
                    <h:column>
                        <f:facet name="header">Start date</f:facet>
                        <h:outputText value="#{c.startDate}">
                            <f:convertDateTime type="date" pattern="dd-MM-yyyy" timeZone="GMT+7"/>
                        </h:outputText>
                    </h:column>
                    <h:column>
                        <h:commandButton action="#{courseStudent.reStudent(c)}" value="View Student" styleClass="btn btn-primary" style="margin-left: 30px; margin-right: -65px"></h:commandButton>
                    </h:column>
                </h:dataTable>
            </h:form> 
        </div>

    </ui:define>

</ui:composition>
